package com.glb.gilibuy.service;

import com.github.pagehelper.PageInfo;
import com.glb.gilibuy.entity.UserReceiveAddress;
import com.glb.gilibuy.web.vo.UserReceiveAddressVO;

import java.util.List;
import java.util.Map;

/**
 * @Description:
 * @Author: Yingtian qian
 * @Date: 2021/8/6 9:13
 */
public interface UserReceiveAddressService {

    /**
     * @Description: 基础Dao方法：根据地址id获取单个收货地址
     * @param:
     * @return:
     */
    UserReceiveAddress selectAddressByAddressId(String addressId);

    /**
     * @Description: 基础Dao方法：根据用户id获取收货地址列表
     * @param:
     * @return:
     */
    List<UserReceiveAddress> selectAddressesByUserId(String userId);

    /**
     * @Description: 基础Dao方法：根据用户id获取单个默认收货地址
     * @param:
     * @return:
     */
    UserReceiveAddress selectDefaultAddress(String userId);

    UserReceiveAddressVO findDefaultAddress(String userId);

    PageInfo findAddressesByUserId(String userId);

    Map<String, Object> addAddress(UserReceiveAddress userReceiveAddress);

    Map<String, Object> updateAddress(UserReceiveAddress userReceiveAddress);

    Map<String, Object> deleteAddress(UserReceiveAddress userReceiveAddress);

    /**
     * @Description: 【过时的方法】
     * @param:
     * @return:
     */
    int addAddressByUserReceiveAddress(UserReceiveAddress userReceiveAddress);

    /**
     * @Description: 【过时的方法】
     * @param:
     * @return:
     */
    int updateAddressIsDefault(String addressId, Integer isDefault);
}
